import { defineStore } from "pinia";
import { ref } from "vue";
import { useRoute } from "vue-router";
export const btnValue = defineStore('getBtn', () => {
const route=useRoute()
    const current=ref('')
    const currentPath =(val:any)=>{
        if(val){
            flagChange(val)
            return current.value=val
        }else{
            flagChange(route.path)
            return current.value= route.path
        }
    }
    const flag=ref(true)
    const flagChange=(val:any)=>{
        if (val == '/tasks/project_management/all_projects' || val == '/home/tasks/project_management/all_projects') {
            flag.value = false
          } else {
            flag.value = true
          }
    }
    return {
        flag,
        current,
        currentPath
    }
})